/*
 * create:2016年4月24日 下午2:16:06
 * author:wangds  
 */
package com.cxkj.shop.biz.commodity;

import java.util.Collection;

import com.cxkj.shop.biz.AbstractShopBusiness;
import com.cxkj.shop.form.DefaultDeliveryBuilder;
import com.cxkj.shop.form.Delivery;
import com.cxkj.shop.form.DeliveryBuilder;
import com.cxkj.shop.model.commodity.Commodity;
import com.cxkj.shop.utils.CommoditiesUtils;

/**
 * .
 * @author wangds
 *
 */
public class LoadScoreCommoditiesBusiness extends AbstractShopBusiness<Object>{

  /*
   * @see com.cxkj.shop.biz.AbstractShopBusiness#proce(java.lang.Object)
   * @author wangds 2016年4月24日 上午11:31:12.
   */
  @Override
  protected Delivery proce(Object input) throws Exception {
    Delivery res = null;
    DeliveryBuilder<Collection<Commodity>> builder = DefaultDeliveryBuilder.getInstance();
    try{
      builder.init();
      builder.setData(CommoditiesUtils.selAllScoreCommodities());
      builder.success();
    }catch(Exception e){
      builder.fail();
    }finally{
      res = builder.toDelivery();
      builder.clear();
    }
    return res;
  }

}
